<?php
 $avatar_path='../uploads/avatar/img.jpg';
$thumb_path=str_replace('avatar/','avatar/thumb_',$avatar_path);
 print_r($thumb_path);
?>